import http from '@/components/common/tui-request'

//获取单位工程下拉列表
export const getProjectUnitProjectManageList = (projectId) => {
	return http.request({
		url: `/project-unit-project/getProjectUnitProjectManageList/${projectId}`,
		method: 'GET',
	});
};

//获取分部分项下拉列表
export const getSysSubsectionManageList = () => {
	return http.request({
		url: `/sys-subsection/getSysSubsectionManageList`,
		method: 'GET',
	});
};

//获取分项验收列表
export const getProjectBranchList = (projectId,page,limit) => {
	return http.request({
		url: `/project-branch/getProjectBranchList/${projectId}/${page}/${limit}`,
		method: 'GET',
	});
};

//新增分项验收
export const addProjectBranch = (projectId,data) => {
	return http.request({
		url: `/project-branch/addProjectBranch/${projectId}`,
		data:data,
		method: 'POST',
	});
};

//送审
export const startProjectBranchProcess = (projectBranchId) => {
	return http.request({
		url: `/project-branch/startProjectBranchProcess?projectBranchId=${projectBranchId}`,
		method: 'POST',
	});
};

//重新送审
export const reStartProjectBranchProcess = (projectBranchId) => {
	return http.request({
		url: `/project-branch/reStartProjectBranchProcess?projectBranchId=${projectBranchId}`,
		method: 'POST',
	});
};

//修改检验批
export const updateProjectBranch = (data) => {
	return http.request({
		url: `/project-branch/updateProjectBranch`,
		method: 'PUT',
		data:data
	});
};

//删除检验批
export const deleteUnSubProjectBranch = (projectBranchId) => {
	return http.request({
		url: `/project-branch/deleteUnSubProjectBranch/${projectBranchId}`,
		method: 'DELETE',
	});
};

//确认审批
export const completeProjectBranchTask = (data) => {
	return http.request({
		url: `/project-branch/completeProjectBranchTask`,
		data:data,
		method: 'POST',
	});
};

//通过id获取分项验收全部信息
export const getFullProjectBranchInfoById = (projectBranchId) => {
	return http.request({
		url: `/project-branch/getFullProjectBranchInfoById?projectBranchId=${projectBranchId}`,
		method: 'GET',
	});
};

//获取未分项验收检验批信息
export const getProjectLotNoCheckedList = (projectId,projectBranchId) => {
	return http.request({
		url: `/project-lot/getProjectLotNoCheckedList/${projectId}?projectBranchId=${projectBranchId}`,
		method: 'GET',
	});
};

//获取用户待办及已办数据
export const getTask = (projectId) => {
	return http.request({
		url: `/project-branch/getTask/${projectId}`,
		method: 'GET',
	});
};